﻿<UserControl x:Class="Startup.Shell.Modules.ClassesModule.ClassesView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:ClassesModule="clr-namespace:Startup.Shell.Modules.ClassesModule"
             xmlns:ClassEditorModule="clr-namespace:Startup.Shell.Modules.ClassEditorModule" mc:Ignorable="d" 
             d:DataContext="{x:Static ClassesModule:ClassesViewModel.Designer}"
             d:DesignHeight="275" d:DesignWidth="631">
	<Grid>
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto" />
			<RowDefinition Height="*" />
		</Grid.RowDefinitions>
		<Grid.ColumnDefinitions>
			<ColumnDefinition Width="200" />
			<ColumnDefinition Width="*" />
		</Grid.ColumnDefinitions>

		<ToolBar>
			<Button Content="New" Command="{Binding NewClassCommand}"/>
		</ToolBar>
		<DataGrid SelectionMode="Single" ItemsSource="{Binding Classes}" SelectedValue="{Binding SelectedClassItem, Mode=OneWayToSource}" Grid.Row="1" Background="White"
                  CanUserAddRows="False" CanUserDeleteRows="False" AlternatingRowBackground="LightGray" AutoGenerateColumns="False" GridLinesVisibility="None">
			<DataGrid.Columns>
				<DataGridTemplateColumn Header="Name">
					<DataGridTemplateColumn.CellTemplate>
						<DataTemplate>
							<TextBox Text="{Binding Name, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Background="Transparent" BorderBrush="Transparent"/>
						</DataTemplate>
					</DataGridTemplateColumn.CellTemplate>
				</DataGridTemplateColumn>
			</DataGrid.Columns>
		</DataGrid>

		<ClassEditorModule:ClassEditorView DataContext="{Binding SelectedViewModel}" Grid.RowSpan="2" Grid.Column="1"/>

	</Grid>
</UserControl>
